/*
 * @Author: 许旺玉
 * @Description: 订单相关接口
 * @Date: 2020-06-28 14:28:10
 * @LastEditTime: 2020-07-06 10:36:33
 * @LastEditors: Please set LastEditors

 */ 
import { ajaxGet,ajaxPost,ajaxPut,ajaxDel} from '@/utlis/request.js'

export function order_type_table(params) {  //订单列表
    const url = 'order'
    return ajaxGet(url, params)
}

export function create_order(data) { //创建订单
    const url = 'order'
    return ajaxPost(url, data)
}

export function order_pay(data) { //支付
    const url = 'order/pay/83'
    return ajaxPost(url, data)
}

export function order_receive(data) { //收货
    const url = 'api/order/receive/1'
    return ajaxPut(url, data)
}

export function order_cancel(data) { //取消订单
    const url = `order/cancel/${data}`
    return ajaxPut(url)
}

export function order_comment(data) { //完成订单后评论商品
    const url = 'order/comment'
    return ajaxPost(url, data)
}

export function order_trace(params) {  //订单物流追踪
    const url = 'order/trace/23'
    return ajaxGet(url, params)
}

export function order_detail(params) {  //订单详情
    const url = `order/detail/${params}`
    return ajaxGet(url, params)
}

export function order_comment_upload(data) { //评论图片上传
    const url = 'order/comment/upload'
    return ajaxPost(url, data)
}

export function order_romove(data) { //订单删除
    const url = `order?${data}`
    return ajaxDel(url)
}